package com.carlinfo.stu_ques.demo.dao.impl;

import java.io.File;

import com.carlinfo.stu_ques.common.dao.impl.BaseDaoimpl;
import com.carlinfo.stu_ques.demo.dao.Iking;
import com.carlinfo.stu_ques.demo.pojo.King;

public class KingDaoimpl extends BaseDaoimpl<King> implements Iking
{
	
	private File file = new File(parentFile, "b.dat");
	
	public KingDaoimpl()
	{
		readFile(file);
	}

	@Override
	public int savaOneDao(King king)
	{
		king.setId(count);
		tempId = king.getId();
		tempId = super.savaOneDao(king);
		writeFile(file);
		return tempId;
	}
	

	@Override
	public void updateOneDao(King king)
	{
		tempId = king.getId();
		super.updateOneDao(king);
		writeFile(file);
	}

	@Override
	public void deleteOneDao(King king)
	{
		tempId = king.getId();
		super.deleteOneDao(king);
		writeFile(file);
	}

}
